package code.rocky.chapter07;

public class Proxy implements Subject {

    // 要代理哪些实现类
    private Subject subject = null;

    public Proxy() {
        subject = new RealSubject();
    }

    public Proxy(Subject _subject) {
        subject = _subject;
    }

    @Override
    public void request() {
        before();
        subject.request();
        after();
    }

    private void after() {
        // do something
    }

    private void before() {
        // do something
    }


}
